package com.gylang.print.pdf.domain.component.table;

import com.gylang.easy.lazy.FunBuilder;
import com.gylang.print.pdf.domain.PdfPageWrapper;
import com.gylang.print.pdf.domain.component.BasePdfComponent;
import com.gylang.print.pdf.enums.PdfComponentEnums;
import com.gylang.print.pdf.enums.PdfFontType;
import lombok.Getter;
import lombok.Setter;
import org.apache.pdfbox.pdmodel.font.PDFont;

import java.awt.*;
import java.util.List;
import java.util.Map;

/**
 * @author gylang
 * data 2021/6/7
 */
@Setter
@Getter
public class TableComponent extends BasePdfComponent implements FunBuilder<TableComponent> {


	/** data数据 */
	private List<Map<String, Object>> dataMap;

	/** bean 映射 */
	private List<Object> mappingBean;


	/** 表格主题 */
	private String title;

	/** 默认字体 */
	private PDFont font;

	private String fontName = PdfFontType.STSONG_TTF;

	/** 日期格式化 */
	private String dateFormat;


	/** 表头字体 */
	private float headerFontSize;

	/** 表头颜色 */
	private Color headerBgColor = Color.WHITE;

	/** 表头文本颜色 */
	private Color headerTextColor = Color.BLACK;

	/** 表格边框颜色 */
	private Color borderColor = Color.BLACK;


	/** 边框厚度 */
	private Integer border = 1;

	private Map<String, PdfTableFieldWrapper> tableFieldWrapper;

	// 位置 -------------------------------------------------------------------------------


	public TableComponent() {
		super(PdfComponentEnums.TABLE.getType());
	}

	public TableComponent(PdfPageWrapper pageWrapper) {
		super(PdfComponentEnums.TABLE.getType());
	}


}
